//
//  FMManageObject.h
//  ZAPlayer
//
//  Created by 邹奥 on 16/4/28.
//  Copyright © 2016年 zouao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDatabase.h"
#import "FMDatabaseAdditions.h"

@interface FMManageObject : NSObject

@property (nonatomic,strong) FMDatabase  *db;
//创建数据库
+ (FMManageObject *)standerDefault;

//歌曲下载-查询
- (NSArray *)onSelectCustomMusicFileCount;
//歌曲下载-根据文件名查询数据库是否存在
- (NSArray *)SelectTableWithFileID:(NSString *)fileName;
//歌曲下载-插入文件数据
- (BOOL)insertTableWithId:(NSString *)idStr withFileName:(NSString *)fileName withFileID:(NSString *)fileID withUrl:(NSString *)url withSize:(NSString *)size withType:(NSString *)type;
//歌曲下载-删除文件数据
- (BOOL)deleteCunstomFileID:(NSString *)CateID;

//搜索历史
- (NSArray *)onSelectSearchHistoryCount;
- (NSArray *)SelectTableBySearchHistoryWithContent:(NSString *)Content withName:(NSString *)name;
- (BOOL)insertTableBySearchHistoryWithId:(NSString *)idStr withName:(NSString *)name withContent:(NSString *)content;
- (BOOL)deleteBySearchHistoryFile:(NSString *)name;

//本地亲子秀 type:6主播秀 5:儿童 7：本地
- (NSArray *)onSelectLocalParentChildShowCount;
- (NSArray *)SelectTableByLocalParentChildShowWithUserId:(NSString *)date withMusicId:(NSString *)musicId;
- (BOOL)insertTableByLocalParentChildShowWithId:(NSString *)idStr withTitle:(NSString *)title withUserId:(NSString *)userId withMusicId:(NSString *)musicID withContent:(NSString *)content withType:(NSString *)type withPicture:(NSString *)picture withDate:(NSString *)date withMp3:(NSString *)mp3 withUserPic:(NSString *)userPic withUserNick:(NSString *)nick withSize:(NSString *)size;
- (BOOL)deleteByLocalParentChildShowFilID:(NSString *)date;
//电台最近播放
-(NSArray*)onSelectPlayHistoryCount;
- (NSArray *)SelectTableByPlayHistoryWithContent:(NSString *)name;
- (BOOL)insertOnShowPlayHistoryTableWithId:(NSString *)idStr withFileName:(NSString *)fileName withFileID:(NSString *)fileID withUrl:(NSString *)url withSize:(NSString *)size withType:(NSString *)type;
- (BOOL)deleteByplayHistoryFile:(NSString *)name;

//点赞
- (NSArray*)onSelectPraiseCount;
- (NSArray *)SelectTableByPraiseWithContentID:(NSString *)name;
- (BOOL)insertOnShowPraiseTableWithId:(NSString *)idStr withIsPraise:(NSString *)isPraise;
- (BOOL)upDateOnShowPraiseTableByID:(NSString *)idStr withIsPraise:(NSString *)isPraise;
- (BOOL)deleteByPraiseFileID:(NSString *)name;
//点赞亲子秀
- (NSArray*)onSelectPraiseForSonCount;
- (NSArray *)SelectTableByPraiseForSonWithContentID:(NSString *)name;
- (BOOL)insertOnShowPraiseForSonTableWithId:(NSString *)idStr withIsPraise:(NSString *)isPraise;
- (BOOL)upDateOnShowPraiseForSonTableByID:(NSString *)idStr withIsPraise:(NSString *)isPraise;
- (BOOL)deleteByPraiseForSonFileID:(NSString *)name;

//最近播放
- (NSArray*)onSelectMusicPlayForRecent;
- (NSArray *)SelectTableByMusicPlayForRecentWithContentID:(NSString *)name;
- (BOOL)insertTableMusicPlayForRecentWithId:(NSString *)idStr withFileName:(NSString *)fileName withFileID:(NSString *)fileID withUrl:(NSString *)url withSize:(NSString *)size withType:(NSString *)type;
- (BOOL)insertTableMusicPlayForRecentWithId:(NSString *)idStr withFileName:(NSString *)fileName withFileID:(NSString *)fileID withUrl:(NSString *)url withSize:(NSString *)size withType:(NSString *)type withCoverPath:(NSString *)coverPath withDate:(NSString *)date withSentiment:(NSString *)sentiment withTitle:(NSString *)title withUserId:(NSString *)userId withUserPic:(NSString *)userPic withUserNick:(NSString *)userNick;
- (BOOL)deleteByMusicPlayForRecentFileID:(NSString *)name;

//最近播放(电台)
- (NSArray*)onSelectRadioAudioPlayForRecent;
- (BOOL)insertTableRadioAudioPlayForRecentWithId:(NSString *)idStr withRaduiName:(NSString *)RaduiName withMainPicture:(NSString *)MainPicture ;
- (BOOL)deleteByRadioAudioPlayForRecentFileID:(NSString *)name;

//添加歌曲和亲子秀
- (NSArray *)onSelectAddLocalParentChildShowCount;
- (NSArray *)SelectTableByAddLocalParentChildShowWithUserId:(NSString *)date withMusicId:(NSString *)musicId withType:(NSString *)type;
- (BOOL)insertTableByAddLocalParentChildShowWithId:(NSString *)idStr withTitle:(NSString *)title withUserId:(NSString *)userId withMusicId:(NSString *)musicID withContent:(NSString *)content withType:(NSString *)type withPicture:(NSString *)picture withDate:(NSString *)date withMp3:(NSString *)mp3 withUserPic:(NSString *)userPic withUserNick:(NSString *)nick withSize:(NSString *)size;
- (BOOL)deleteByAddLocalParentChildShowFilID:(NSString *)date;

@end
